<?php

/**
 * 默认控制器
 */
class Controller_Default extends Controller_Abstract
{
    function actionIndex()
    {    //文字连接	
    	$char_link = Contents::find('model = 3 and status = 1 and cateid = 79 and (expire>? or expire = 0)',time())->getall();
    	$this->_view['char_link'] = $char_link;
    	//图片连接
    	$img_link = Contents::find('model = 3 and status = 1 and cateid = 80  and (expire>? or expire = 0)',time())->getall();
    	$this->_view['img_link'] = $img_link;
    	$online = Online::find()->top('10')->getAll();
    	$this->_view['online'] = $online;
    	
    	$topList = Product::find('istop = 1')->top(10)->getAll();
    	$ptypeid = Categorys::find('parentid = 118')->setColumns('id')->asArray()->getAll();
    	$ptypeid = Helper_Array::toHashmap($ptypeid, 'id','id');
    	
    	$personPro = Product::find("type in(".implode(',', ($ptypeid)).")")->top(10)->getAll();
    	
    	$ptypeid = Categorys::find('parentid = 119')->setColumns('id')->asArray()->getAll();
    	$ptypeid = Helper_Array::toHashmap($ptypeid, 'id','id');
    	 
    	$qiyePro = Product::find("type in(".implode(',', ($ptypeid)).")")->top(10)->getAll();
    	 
    	$this->_view['topList'] = $topList;
    	$this->_view['personPro'] = $personPro;
    	$this->_view['qiyePro'] = $qiyePro;
    	 
    	
    }
    function actiontest()
    {
    	$pro = Q::ini('appini/product');
    	dump($pro);
    	
    }
}